using System;

namespace Gadgeteer.Interfaces.Fakes.Framework
{
    public abstract class Disposable : IDisposable
    {
        protected abstract void DisposeManaged();

        #region Dispose
        private bool disposed = false;

        protected virtual void Dispose(bool disposing)
        {
            if (disposed == false)
            {
                if (disposing)
                {
                    DisposeManaged();
                }
            }
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        #endregion
    }
}
